<template>
  <el-pagination
    background
    :current-page="formlist.pagenum"
    :page-sizes="[5, 10, 20, 40]"
    :page-size="formlist.pagesize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>

<script>
export default {
  props: {
    total: {
      type: [Number, String],
      required: true
    },
    formlist: {
      type: Object,
      required: true
    }
  },
  data () {
    return {
      currentPage4: 4
    }
  },

  created () {

  },

  methods: {
    handleSizeChange (val) {
      // console.log(`每页 ${val} 条`)
      this.formlist.pagesize = val
      this.$emit('on-success', this.formlist)
    },
    handleCurrentChange (val) {
      // console.log(`当前页: ${val}`)
      this.formlist.page = val
      this.$emit('on-success', this.formlist)
    }

  }
}
</script>

<style scoped lang='less'>
</style>
